import httpInstance from "@/utils/http";

export function getCategoryAPI(){
    return httpInstance({
        url: '/category/categoryInfo'
    })
}

export function getCategoryByIdAPI(id){
    return httpInstance({
        url: '/category/categoryById',
        params: {
            id
        }
    })
}

/**
 * @description: 获取二级分类列表数据
 * @param {*} id 分类id 
 * @return {*}
 */
export function getSubCategoryAPI(id){
    return httpInstance({
      url:'/category/subCategory',
      params:{
        id
      }
    })
}

/**
 * @description: 获取导航数据
 * @data { 
     categoryId: 1005000 ,
     page: 1,
     pageSize: 20,
     sortField: 'publishTime' | 'orderNum' | 'evaluateNum'
   } 
 * @return {*}
 */
   export function getSubCategoryGoodsAPI(data){
    return httpInstance({
      url:'/category/goodsList',
      method:'POST',
      data
    })
  }
